<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2902：一道水题</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">一道水题</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">一道水题</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                一道水题                </h1>
                <p>时间限制：20s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：256MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="punctuation-wrap: simple"><span style="font-size: medium"><span style="color: black">&nbsp;&nbsp;&nbsp; </span><span style="color: black">话说世界上有很多被大神狂虐的水题，比如说上面第二题，在很久很久以前就被很多很多大神在某</span><span style="color: black">OJ</span><span style="color: black">上直接</span><span style="color: black">AC</span><span style="color: black">。本题也是一道水题，自从</span><span style="color: black">2012</span><span style="color: black">年二月份以来，全国的</span><span style="color: black">Oier</span><span style="color: black">就没有没在半小时之内水过这道题的。</span></span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium"><span style="color: black">&nbsp;&nbsp;&nbsp; </span><span style="color: black">其实本题就是这么一道水题：话说某题库，在某些神题中掺了很多道水题，一位大神突发奇想，想在尽可能短的时间内把水题全部</span><span style="color: black">AC</span><span style="color: black">。大神一般是这么做题的，他会在一秒钟之内把第</span><span style="color: black">i</span><span style="color: black">题到第</span><span style="color: black">i+L</span><span style="color: black">题全部</span><span style="color: black">AC</span><span style="color: black">。大神早就把水题的分布全都摸透了，所以说水题被切是其从诞生起就注定了的命运。不过大神还有别的神题去做，没有太多时间花在水题上，所以他得在尽可能少的时间内将水题切完。为了合理安排水题的切题计划，大神写了个程序来规划。</span></span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium"><span style="color: black">但题库的管理员恶意地想拖慢大神刷水题的速度，于是他老是更改水题的位置，试图使大神的程序判断失误，从而延误大神的时间。当然了，大神的程序是无敌的，管理员每更改水题的位置，大神的程序多可以在极短的时间内判断出大神切水题的时间。而本题也就是这么个问题。</span></span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium"><span style="color: black">&nbsp;&nbsp;&nbsp; </span><span style="color: black">你就是那位大神</span><span style="color: black">&mdash;&mdash;</span><span style="color: black">湖南</span><span style="color: black">Oier</span><span style="color: black">中的精英。你得为你的切水题计划重新写一个程序了。当然，作为大神的你自然不屑于做这种水题。你可以选择不做此题，而在程序中打出&ldquo;</span><span style="color: black">I am a godlike cowcowcow!</span><span style="color: black">&rdquo;，从而积蓄</span><span style="color: black">RP</span><span style="color: black">，在</span><span style="color: black">NOI</span><span style="color: black">上虐爆全场吧！</span></span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium"><span style="color: black">&nbsp;&nbsp;&nbsp; </span><span style="color: black">注意，管理员可没有保证水题不会在一个位置重合。</span></span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;</span></div></p><hr/><h3>输入格式</h3><p><div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;&nbsp;&nbsp; 第一行三个正整数n，L，m。n是水题数目，m是管理员更改水题位置的数目。 </span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;&nbsp;&nbsp; 接下来n个数，表示n道水题的初始位置。</span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;&nbsp;&nbsp; 接下来m行，每行两个数i(0&lt;=i&lt;n)，y(0&lt;=y&lt;=1000000000)。表示将第i+1道水题改到y（按输入顺序排名）。</span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;</span></div></p><hr/><h3>输出格式</h3><p><div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;&nbsp;&nbsp; 输出共m行，表示第i次管理员改变水题的位置后大神切题所需时间(以秒为单位)。</span></div>
<div style="punctuation-wrap: simple"><span style="font-size: medium">&nbsp;</span></div></p><hr/><h3>样例输入</h3><pre>4 10 5
10 15 17 20
2 16
1 25
3 35
0 38
2 0
 
</pre><hr/><h3>样例输出</h3><pre>1
2
2
2
3 
 
 
 
 </pre><hr/><h3>提示</h3><p><p>对100%的数据满足，n，m &lt;= 150000，L &lt;= 1000000000。<br />
</p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2902" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2902" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>